﻿using Service.Auth.Domain.AggregatesModel;
using Service.Core.Redis.Aop.Cache;
using Service.Core.Repository;
using Service.Framework;

namespace Service.Auth.Api.Application.Query;

/// <summary>
/// Api资源表
/// </summary>
/// <param name="repository"></param>
public class ScopeApiResourcesQueryService(IRepository<ScopeApiResources> repository) : IScopedService
{
    [RedisCacheInterceptor($"{nameof(ScopeApiResourcesQueryService)}:{nameof(QueryScopeApiResourcesList)}", cacheDuration: 60 * 30)] //AOP缓存,虚方法
    public virtual async Task<List<ScopeApiResources>> QueryScopeApiResourcesList()
    {
        return await repository.GetListAsync();
    }
}